package cn.sirun.com.fca.account.service;


import java.util.ArrayList;
import java.util.List;

/**
 * 状态码管理类
 *
 * @author showxiao
 * @date 2018/10/17
 */
public final class StatusCodeManager {

    private static final StatusCodeManager sInstance = new StatusCodeManager();

    public static StatusCodeManager getInstance() {
        return sInstance;
    }

    private List<Integer> mInvalidCodeList;

    private StatusCodeManager() {
        initInvalidCodeList();
    }

    private void initInvalidCodeList() {
        mInvalidCodeList = new ArrayList<>();
//        addInvalidCode(AccountStatusCode.LOGIN_STATUS_INVALID);
//        addInvalidCode(AccountStatusCode.LOGIN_COOKIE_NON_EXISTENT);
//        addInvalidCode(AccountStatusCode.LOGIN_STATUS_VERIFY_FAILED);
//        addInvalidCode(AccountStatusCode.ACCESS_SESSION_ID_INVALID);
//        addInvalidCode(AccountStatusCode.ACCOUNT_SESSION_ID_INVALID);
    }

    public void addInvalidCode(int code) {
        mInvalidCodeList.add(code);
    }

    public boolean isInvalidCode(int code) {
        return mInvalidCodeList.contains(code);
    }

}
